Skip to content

feat(aarch64): Seed entropy using ARM RNG - #2528

Merged
mkroening merged 1 commit into
hermit-os:mainfrom
sbutz:sb/seed_arm_rng
Jul 26, 2026
Merged

feat(aarch64): Seed entropy using ARM RNG#2528
mkroening merged 1 commit into
hermit-os:mainfrom
sbutz:sb/seed_arm_rng

Conversation

@sbutz

@sbutz sbutz commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Implement missing entropy seeding on ARM.
ArmRng Implentation
ARM Doc

For RISC-V we could leverage the optional Zkr extension.
RISC-V Doc
Changes follow in separate PR.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 1eb3c99 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 81.32 s 80.34 s 1.01
startup_benchmark File Size 0.79 MB 0.80 MB 0.99
Startup Time - 1 core 0.73 s (±0.02 s) 0.75 s (±0.02 s) 0.97
Startup Time - 2 cores 0.74 s (±0.02 s) 0.74 s (±0.02 s) 1.01
Startup Time - 4 cores 0.74 s (±0.02 s) 0.74 s (±0.02 s) 0.99
multithreaded_benchmark Build Time 78.79 s 82.11 s 0.96
multithreaded_benchmark File Size 0.90 MB 0.86 MB 1.05
Multithreaded Pi Efficiency - 2 Threads 87.36 % (±7.58 %) 85.89 % (±6.61 %) 1.02
Multithreaded Pi Efficiency - 4 Threads 43.75 % (±2.22 %) 43.43 % (±2.56 %) 1.01
Multithreaded Pi Efficiency - 8 Threads 25.09 % (±2.35 %) 25.76 % (±1.53 %) 0.97
micro_benchmarks Build Time 76.24 s 80.40 s 0.95
micro_benchmarks File Size 0.90 MB 0.86 MB 1.05
Scheduling time - 1 thread 62.25 ticks (±1.44 ticks) 62.65 ticks (±4.06 ticks) 0.99
Scheduling time - 2 threads 33.90 ticks (±4.39 ticks) 34.08 ticks (±4.10 ticks) 0.99
Micro - Time for syscall (getpid) 3.95 ticks (±0.66 ticks) 3.45 ticks (±0.58 ticks) 1.15
Memcpy speed - (built_in) block size 4096 87477.92 MByte/s (±60540.37 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 1.06
Memcpy speed - (built_in) block size 1048576 31011.24 MByte/s (±24831.75 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 1.01
Memcpy speed - (built_in) block size 16777216 29668.79 MByte/s (±24338.01 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.13
Memset speed - (built_in) block size 4096 87651.70 MByte/s (±60669.90 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 1.07
Memset speed - (built_in) block size 1048576 31744.03 MByte/s (±25263.02 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 1.01
Memset speed - (built_in) block size 16777216 30279.44 MByte/s (±24645.22 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.12
Memcpy speed - (rust) block size 4096 78115.65 MByte/s (±54379.45 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 1.05
Memcpy speed - (rust) block size 1048576 30677.28 MByte/s (±24731.72 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 1.01
Memcpy speed - (rust) block size 16777216 29642.50 MByte/s (±24328.39 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 1.07
Memset speed - (rust) block size 4096 78754.19 MByte/s (±54843.98 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 1.06
Memset speed - (rust) block size 1048576 31450.20 MByte/s (±25175.46 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 1.01
Memset speed - (rust) block size 16777216 30417.57 MByte/s (±24773.20 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 1.07
alloc_benchmarks Build Time 76.69 s 74.76 s 1.03
alloc_benchmarks File Size 0.87 MB 0.87 MB 1.00
Allocations - Allocation success 91.31 % 91.31 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.44 % 61.44 % 1
Allocations - Average Allocation time 3126.82 Ticks (±201.45 Ticks) 5860.58 Ticks (±98.43 Ticks) 0.53
Allocations - Average Allocation time (no fail) 4070.80 Ticks (±189.18 Ticks) 6554.81 Ticks (±92.86 Ticks) 0.62
Allocations - Average Deallocation time 796.81 Ticks (±146.02 Ticks) 1805.01 Ticks (±250.35 Ticks) 0.44
mutex_benchmark Build Time 75.85 s 79.82 s 0.95
mutex_benchmark File Size 0.90 MB 0.86 MB 1.05
Mutex Stress Test Average Time per Iteration - 1 Threads 11.82 ns (±0.55 ns) 12.10 ns (±0.41 ns) 0.98
Mutex Stress Test Average Time per Iteration - 2 Threads 38.08 ns (±1.81 ns) 40.26 ns (±1.68 ns) 0.95

This comment was automatically generated by workflow using github-action-benchmark.

@sbutz
sbutz force-pushed the sb/seed_arm_rng branch from e279038 to 414125f Compare July 6, 2026 11:50
@mkroening mkroening self-assigned this Jul 6, 2026
@sbutz
sbutz marked this pull request as ready for review July 6, 2026 12:46

@mkroening mkroening left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great! :)

Comment thread src/arch/aarch64/kernel/processor.rs Outdated
Comment thread src/arch/aarch64/kernel/processor.rs Outdated
Comment thread src/arch/aarch64/kernel/processor.rs Outdated
@mkroening

Copy link
Copy Markdown
Member

I have opened #2544 to enable the CPU feature in CI.

@sbutz
sbutz force-pushed the sb/seed_arm_rng branch from 414125f to 9f0a752 Compare July 10, 2026 12:08
@mkroening mkroening changed the title Seed entropy using arm rng feat(aarch64): Seed entropy using ARM RNG Jul 26, 2026

@mkroening mkroening left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great! Also, thanks for your patience.

I have rebased to have CI run this with -cpu max,lpa2=off (#2544).

Edit: I'll rebase once more after #2545 is merged.

Tested successfully on qemu with `-cpu neoverse-v1`.
@mkroening
mkroening enabled auto-merge July 26, 2026 10:45
@mkroening
mkroening added this pull request to the merge queue Jul 26, 2026
Merged via the queue into hermit-os:main with commit cbe190b Jul 26, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants